package net.lastcoder.ifserver;

import java.io.File;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Properties;

public class Constants {
    public static final String SERVER_NAME = "ifserver";

    public static final int infinite = -1;

    public static final int SECOND = 1000;
    public static final int MINUTE = 60 * SECOND;
    public static final int HOUR = 60 * MINUTE;
    public static final int DAY = 24 * HOUR;
    public static final int WEEK = 7 * DAY;

    public static final int DEFAULT_PORT = 9529;

    public static final String RELOAD_DESC = "server reload";
    public static final String SHUTDOWN_DESC = "server shutdown";
    public static final String CONFLICT_DESC = "conflict";

    public static final String AUTH_ERROR = "auth error";
    public static final String NOT_USER_ERROR = "not user error";

    public static final byte PACKET_TYPE_SESSION_OPEN = 0x00;
    public static final byte PACKET_TYPE_SESSION_CLOSE = 0x01;
    public static final byte PACKET_TYPE_MESSAGE = 0x10;
    public static final byte PACKET_TYPE_EVENT = 0x20;

    public static final String LINE_END_CHAR = "\n";

    public static final byte PACKET_TYPE_ZERO = 0x30;
    public static final Charset DEFAUT_CAHRSET = Charset.defaultCharset();

    public static boolean isDebug() {
        return Boolean.getBoolean("developmentMode");
    }

    public static SimpleDateFormat DateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
}
